package com.example.spring_vue.controller;

import com.example.spring_vue.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmailController {
    //注入email配置信息实体类
    @Autowired
    private EmailService emailService;

    //测试方法
    @RequestMapping("/send")
    public Boolean send() {
        //收件人信箱
        String to = "298690065@qq.com";
        //邮箱标题
        String title = "test email";
        //邮件正文
        String content = "1111111";
        //发送邮件
        return emailService.send(to, title, content);
    }
}
